package com.gopay.cron.web.util;

import com.gopay.common.constants.approval.DecisionValue;
import com.gopay.common.constants.cust.CustCorpInfoConstants;
import com.gopay.common.constants.cust.CustPersonInfoConstants;
import com.gopay.common.constants.order.OrderAdjustRecordStatus;
import com.gopay.common.constants.trans.*;
import com.gopay.common.domain.acps.AcctProd;
import com.gopay.common.domain.acps.AcctStatus;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * 翻译部分字典值，便于页面显示
 * 
 * @DicTranslate.java
 * @author HJY
 * @2013-3-13 上午09:31:43 www.gopay.com.cn Inc.All rights reserved.
 */
public class DicTranslate {

	//log
	private static Logger logger = LoggerFactory.getLogger(DicTranslate.class);
	
	private static Map<String, String> intTxnCdMap = new HashMap<String, String>();

	static {
		/** 通用支付 */
		intTxnCdMap.put("00100", "网关支付");
		/** 大宗入金 */
		intTxnCdMap.put("00200", "入金");
		/** 大宗划拨收益 */
		intTxnCdMap.put("00201", "划拨收益");
		/** 大宗出金 */
		intTxnCdMap.put("00202", "出金");
		/** 大宗签约 */
		intTxnCdMap.put("00203", "签约");
		/** 大宗解约 */
		intTxnCdMap.put("00204", "解约");
		/** 大宗签到 */
		intTxnCdMap.put("00205", "大宗签到");
		/** 大宗签退 */
		intTxnCdMap.put("00206", "大宗签退");
        /** 大宗市场入金 */
        intTxnCdMap.put("00207", "大宗市场入金");

		/** 海外购物支付 */
		intTxnCdMap.put("00300", "海外购物支付");
		/** 海外购物退款 */
		intTxnCdMap.put("00301", "海外购物退款");
		/** 海外购物支付确认 */
		intTxnCdMap.put("00302", "海外购物支付确认");

		/** 通用担保支付申请 */
		intTxnCdMap.put("00400", "担保支付申请");
		/** 通用担保支付（部分）完成 */
		intTxnCdMap.put("00401", "担保支付完成");
		/** 通用担保支付取消 */
		intTxnCdMap.put("00402", "担保支付取消");

		/** 虚拟账户充值 */
		intTxnCdMap.put("00500", "充值");
		/** 保证金 **/
		intTxnCdMap.put("00501","上缴保证金");
		intTxnCdMap.put("00502","返还保证金");

		/** 代扣服务费 */
		intTxnCdMap.put("00600", "代扣");
		/** 收款分账 */
		intTxnCdMap.put("00606", "收款分账");

		/** 付款到银行 */
		intTxnCdMap.put("00700", "付款到银行");

		/** 提现 */
		intTxnCdMap.put("00800", "提现");

		/** 付款到国付宝 */
		intTxnCdMap.put("00900", "付款到国付宝");

		/** 付款到关联账户 */
		intTxnCdMap.put("00901", "关联账户转账");

		/** 虚拟账户担保转账申请 */
		intTxnCdMap.put("01000", "虚拟账户担保转账申请");
		/** 虚拟账户担保转账完成 */
		intTxnCdMap.put("01001", "虚拟账户担保转账完成");
		/** 虚拟账户担保转账取消 */
		intTxnCdMap.put("01002", "虚拟账户担保转账取消");

		/** 锁定保证金 */
		intTxnCdMap.put("01100", "锁定保证金");
		/** 解锁保证金 */
		intTxnCdMap.put("01101", "解锁保证金");

		/** 收款交易退款 */
		intTxnCdMap.put("01200", "退款");
		/** 付款交易退款 */
		intTxnCdMap.put("01201", "付款交易退款");
		/** 分账退款 */
		intTxnCdMap.put("01202", "收款分账退款");
		/** 收款退款 */
		intTxnCdMap.put("01203", "收款退款");

		/** 错账长款调账 */
		intTxnCdMap.put("09800", "手工调账");
		/** 错账短款调账 */
		intTxnCdMap.put("09801", "错账短款调账");
		/** 冻结余额 */
        intTxnCdMap.put("09802", "冻结可用余额");
        /** 解冻余额 */
        intTxnCdMap.put("09803", "解冻可用余额");        

		/** 银行卡重复支付冲正 */
		intTxnCdMap.put("09900", "银行卡重复支付冲正");
		/** 信用卡充值冲正 */
		intTxnCdMap.put("09901", "信用卡充值冲正");
		/** 海外购物交易超时冲正 */
		intTxnCdMap.put("09902", "海外购物交易超时冲正");
		/** 结算收益金 */
		intTxnCdMap.put("09700", "结算收益金");
		
		/** 专属账户充值 */
		intTxnCdMap.put("01300", "专属账户充值");
	    /** 专属账户提现至国付宝 */
		intTxnCdMap.put("01311", "专属账户提现至国付宝");
	    /** 专属账户提现 */
		intTxnCdMap.put("01301", "专属账户提现");
	    /** G商融通转账 */
		intTxnCdMap.put("01302", "G商融通转账");
	    /** 投标完成 */
		intTxnCdMap.put("01303", "投标完成");
	    /** G商融通绑定 */
		intTxnCdMap.put("01304", "G商融通绑定");
		/** 返润 */
        intTxnCdMap.put("01400", "返润");
        /** 个人扫商户 */
        intTxnCdMap.put("01601", "个人扫商户");
        /** 返润 */
        intTxnCdMap.put("01602", "商户扫个人");
        /** 手机转账到国付宝*/
        intTxnCdMap.put("01603", "手机转账到国付宝");
        /** 商户扫商户  */
        intTxnCdMap.put("01604", "商户扫商户 ");
        /** 手机转账到银行卡 */
        intTxnCdMap.put("01605", "手机转账到银行卡");
        /** 信用卡还款 */
        intTxnCdMap.put("01606", "信用卡还款");
        /** 我要收款*/
        intTxnCdMap.put("01607", "我要收款");
        /** 发红包*/
        intTxnCdMap.put("01608", "发红包");
        /** 领红包*/
        intTxnCdMap.put("01609", "领红包");
        /** 红包退款*/
        intTxnCdMap.put("01610", "红包退款");
        /** 手机钱包 话费充值 */
        intTxnCdMap.put("01611", "手机钱包话费充值");
        /**手机钱包 流量充值*/
        intTxnCdMap.put("01612", "手机钱包流量充值");
        /** 加油卡充值*/
        intTxnCdMap.put("01613", "加油卡充值");
		/** 一分钱快捷支付*/
		intTxnCdMap.put("01614", "一分钱快捷支付");
		/** 理财支付*/
		intTxnCdMap.put("01615", "理财支付");
		/** 理财兑付到国付宝*/
        intTxnCdMap.put("01616", "理财兑付到国付宝");
        /** 理财兑付到银行*/
        intTxnCdMap.put("01617", "理财兑付到银行");
        /** 手机钱包视频会员卡充值 add by zhoupeng 20170619*/
        intTxnCdMap.put("01618", "手机钱包视频会员");
        /**云账户冻结*/
        intTxnCdMap.put("01807", "冻结");
        /**云账户解冻*/
        intTxnCdMap.put("01808", "解冻");
        /**云账户转账冻结*/
        intTxnCdMap.put("01809", "转账冻结");
        /**云账户转账*/
        intTxnCdMap.put("01810", "转账（解冻转账退款）");
        /**云账户解冻转账*/
        intTxnCdMap.put("01811", "解冻转账"); 
        /**云账户转账(B2B)*/
        intTxnCdMap.put("01812", "云账户转账");

		/*基金添加  baiyunpeng 20160909 start*/
		intTxnCdMap.put("02004", "基金申购/认购交易");
		intTxnCdMap.put("02012", "基金赎回/分红/退款交易");
		intTxnCdMap.put("02018", "基金转国付宝交易");
		intTxnCdMap.put("02016", "国付宝转基金交易");
		/*基金添加  baiyunpeng 20160909 end*/
		/*add by liuyu, 20170526, 商财通添加交易类型Start*/
		intTxnCdMap.put("02013", "理财转入");
        intTxnCdMap.put("02014", "理财转出");
        intTxnCdMap.put("02015", "理财退款");
		/*add by liuyu, 20170526, 商财通添加交易类型End*/
        /**
         * 存管资金结算
         */
        intTxnCdMap.put("02200", "存管资金结算");
		//航空商户增加退款转账
		intTxnCdMap.put("00701", "退款转账");

		//内部交易
		intTxnCdMap.put("00702", "分润到国付宝");
		intTxnCdMap.put("00703", "分润到银行");
		intTxnCdMap.put("00704", "强制扣款");
		intTxnCdMap.put("00705", "返点");

		/**委托代收交易**/
		intTxnCdMap.put("00666", "委托代收交易");
        /**
         * 聚合支付
         */
        intTxnCdMap.put("02301", "聚合支付");
        /**
         * 三方小额免密撤销
         */
        intTxnCdMap.put("02302", "三方条码支付撤销");

		intTxnCdMap.put("00664","委托代收授权");


	}

	/**
	 * 翻译账户状态
	 * 
	 * @param code
	 * @return
	 */
	public static String getAcctStatusName(AcctStatus code) {
		String statusName = "未知";
		switch (code) {
		case A:
			statusName = "正常";
			break;
		case F:
			statusName = "冻结";
			break;
		case D:
			statusName = "休眠";
			break;
		case C:
			statusName = "注销";
			break;

		default:
			break;
		}
		return statusName;
	}
	/**
	 * 翻译账户状态
	 * 
	 * @param code
	 * @return
	 */
	public static String getAcctStatusName(String code) {
	    String statusName = "未知";
	    if(null!=code&&!"".equals(code)){
	    String codeChange=code.trim();
	    if("A".equals(codeChange)){
	       statusName = "正常"; 	      
	    }else if("F".equals(codeChange)){
	        statusName = "冻结"; 
	    }else if("D".equals(codeChange)){
	        statusName = "休眠"; 
	    }else if("C".equals(codeChange)){
	        statusName = "注销";
	    }else{}
	 }
	    return statusName;
	}

	/**
	 * 币种翻译
	 * 
	 * @param code
	 * @return
	 */
	public static String getCurTypeName(CurrencyCode code) {
		String typeName = "未知";
		switch (code) {
		case CNY:
			typeName = "人民币";
			break;
		case HKD:
			typeName = "港元";
			break;
		case USD:
			typeName = "美元";
			break;
		case EURO:
			typeName = "欧元";
			break;
		case JPY:
			typeName = "日元";
			break;
		case AUD:
			typeName = "澳洲元";
			break;

		default:
			break;
		}
		return typeName;
	}

	/**
	 * 币种翻译
	 * 
	 * @param code
	 * @return
	 */
	public static String getCurTypeName(String code) {
	    String typeName = "未知";  
        
        if(StringUtils.isNumeric(code)){
            if (StringUtils.equals(code, CurrencyCode.CNY.value)) {
                typeName = "人民币";
            } else if (StringUtils.equals(code, CurrencyCode.HKD.value)) {
                typeName = "港元";
            } else if (StringUtils.equals(code, CurrencyCode.USD.value)) {
                typeName = "美元";
            } else if (StringUtils.equals(code, CurrencyCode.EURO.value)) {
                typeName = "欧元";
            } else if (StringUtils.equals(code, CurrencyCode.JPY.value)) {
                typeName = "日元";
            } else if (StringUtils.equals(code, CurrencyCode.AUD.value)) {
                typeName = "澳洲元";
            }
        }else{
            if (StringUtils.equals(code, CurrencyCode.CNY.name())) {
                typeName = "人民币";
            } else if (StringUtils.equals(code, CurrencyCode.HKD.name())) {
                typeName = "港元";
            } else if (StringUtils.equals(code, CurrencyCode.USD.name())) {
                typeName = "美元";
            } else if (StringUtils.equals(code, CurrencyCode.EURO.name())) {
                typeName = "欧元";
            } else if (StringUtils.equals(code, CurrencyCode.JPY.name())) {
                typeName = "日元";
            } else if (StringUtils.equals(code, CurrencyCode.AUD.name())) {
                typeName = "澳洲元";
            }
        }
        return typeName;
	}


	/**
	 * 订单交易状态
	 * 
	 * @param code
	 * @return
	 */
	 public static String getTxnStaCdName(int code) {
	        String typeName = "";
	        if (code == TxnStaCode.TXN_STA_CD_30000.value) {
	            typeName = "进行中";
	        }else if (code == TxnStaCode.TXN_STA_CD_20000.value) {
	            typeName = "成功";
	        } else if (code == TxnStaCode.TXN_STA_CD_30101.value) {
	            typeName = "出款清算单位处理中";
	        } else if (code == TxnStaCode.TXN_STA_CD_30102.value) {
	            typeName = "出款清算单位成功";
	        } else if (code == TxnStaCode.TXN_STA_CD_90000.value) {
	            typeName = "系统异常处理失败";
	        } else if (code == TxnStaCode.TXN_STA_CD_90001.value) {
	            typeName = "超时";
	        } else if (code == TxnStaCode.TXN_STA_CD_90201.value) {
	            typeName = "账务处理失败";
	        } else if (code == TxnStaCode.TXN_STA_CD_20001.value) {
	            typeName = "作废";
	        } else if (code == TxnStaCode.TXN_STA_CD_20003.value) {
	            typeName = "审批不通过";
	        }else if (code == TxnStaCode.TXN_STA_CD_90101.value) {
	            typeName = "出款清算单位失败";
	        } else if (code == TxnStaCode.TXN_STA_CD_20002.value) {
	            typeName = "失效";
	        }
	        return typeName;
	    }

	/**
	 * 翻译内部交易吗
	 * 
	 * @param intTxnCd 内部交易码
	 * */
	public static String getIntTxnCdStr(String intTxnCd) {
		String ret = intTxnCdMap.get(intTxnCd);
		return StringUtils.isNotBlank(ret) ? ret : "未知交易";
	}

	/**
	 * 翻译交易状态(只分 成功失败进行中 三种)
	 * <b>该方法已废弃 建议使用 TxnStaCode.getCategory 作为替换 lx 2018-2-24 15:17:21 </b>
	 * @param txnStaCd
	 * @return
	 */
	@Deprecated
    public static String translateTranStatus(int txnStaCd) {
        if (txnStaCd == TxnStaCode.TXN_STA_CD_20000.value) {
            return "成功";
		} else if (txnStaCd >= TxnStaCode.TXN_STA_CD_90000.value) { //生产三期：订单状态翻译 add by zhaojt
			return "进行中";
		}else if (txnStaCd>=30000 && txnStaCd<40000) {
            return "进行中";
        } else {
            return "失败";
        }
    }

	/**
	 * 获取付款通道名称
	 * 
	 * @param payChanel
	 *            付款通道类型
	 * @return
	 */
	public static String getPayChannelName(String payChanel) {
		try {
			return PayChannel.translate(payChanel);
		} catch (Exception e) {
			logger.error("付款通道翻译错误"+payChanel);
		}
		//解决测试环境别的项目新增付款通道类型导致翻译报错
		return "";
//		String channelName = "";
//		if (StringUtils.isBlank(payChanel))
//			return channelName;
//		if (PayChannel._00.value.equals(payChanel)) {
//			channelName = "本订单不涉及付款";
//		} else if (PayChannel._01.value.equals(payChanel)) {
//			channelName = "个人网银付款";
//		} else if (PayChannel._02.value.equals(payChanel)) {
//			channelName = "个人虚拟账户付款";
//		} else if (PayChannel._03.value.equals(payChanel)) {
//			channelName = "个人借记卡快捷付款";
//		} else if (PayChannel._04.value.equals(payChanel)) {
//			channelName = "个人信用卡无卡付款";
//		} else if (PayChannel._06.value.equals(payChanel)) {
//			channelName = "个人信用卡快捷付款";
//		}else if (PayChannel._08.value.equals(payChanel)) {
//			channelName = "个人WAP网银付款";
//		}
//		else if (PayChannel._49.value.equals(payChanel)) {
//			channelName = "个人银行汇款";
//		} else if (PayChannel._50.value.equals(payChanel)) {
//			channelName = "个人现金付款";
//		} else if (PayChannel._51.value.equals(payChanel)) {
//			channelName = "企业网银付款";
//		} else if (PayChannel._52.value.equals(payChanel)) {
//			channelName = "企业虚拟账户付款";
//		} else if (PayChannel._98.value.equals(payChanel)) {
//			channelName = "企业银行汇款";
//		} else if (PayChannel._99.value.equals(payChanel)) {
//			channelName = "企业现金付款";
//			//add by gaocl at 20160810---start
//		}else if (PayChannel._30.value.equals(payChanel)) {
//            channelName = "个人信用卡快捷支付付款(API)";
//        }else if (PayChannel._31.value.equals(payChanel)) {
//            channelName = "个人借记卡快捷支付付款(API)";
//        }else if (PayChannel._32.value.equals(payChanel)) {
//            channelName = "个人代扣支付付款(API)";
//        }else if (PayChannel._16.value.equals(payChanel)) {
//            channelName = "三方扫码支付";
//        } else if (PayChannel._17.value.equals(payChanel)) {
//            channelName = "三方APP支付"; //add by gaocl at 20160810---end
//        } else if(PayChannel._18.value.equals(payChanel)) { // add by jianglijun 微信公众号支付 20161013
//			channelName = "公众号扫码支付";
//		}
//
//		return channelName;


	}


	/**
	 * 翻译对公对私
	 */
	public static String getBCFlag(String bcode) {
		String bcflag = "不区分";
		if (bcode.equals(BCFlag.BC_FLAG_C.value)) {
			bcflag = "对公";
		} else if (bcode.equals(BCFlag.BC_FLAG_P.value)) {
			bcflag = "对私";
		}
		return bcflag;
	}
	
	/**
	 * 翻译审核是否通过
	 */
	public static String getAuditResult(int flag){
		String re="未知";
		if (flag==DecisionValue.AGREE.value){
			re="审核通过";
		}else if (flag==DecisionValue.REJECT.value){
			re="审核拒绝";
		}
		return re;
	}

    /**
     * 翻译付款渠道，，只有线上，线下之分
     */
    public static String getPayChannel(String paychanels) {
        String payChannelName = "未知";
        if (PayChannel._00.value.equals(paychanels) || PayChannel._01.value.equals(paychanels) || PayChannel._02.value.equals(paychanels)
                || PayChannel._03.value.equals(paychanels) || PayChannel._49.value.equals(paychanels) || PayChannel._50.value.equals(paychanels)
                || PayChannel._51.value.equals(paychanels) || PayChannel._52.value.equals(paychanels)|| PayChannel._30.value.equals(paychanels)
                || PayChannel._31.value.equals(paychanels)|| PayChannel._32.value.equals(paychanels)|| PayChannel._16.value.equals(paychanels)
                || PayChannel._17.value.equals(paychanels)||PayChannel._18.value.equals(paychanels)||PayChannel._25.value.equals(paychanels)) {
            payChannelName = "线上";
        } else if (PayChannel._98.value.equals(paychanels) || PayChannel._99.value.equals(paychanels)) {
            payChannelName = "线下";
        }

        return payChannelName;

    }

    /**
     * 获取客户级别
     */
    public static String getCustLevel(String PRIVILEGE) {
        String custLevel = "未知";
        if (StringUtils.isBlank(PRIVILEGE))
            return custLevel;
        if (PRIVILEGE.equals("0")) {
            custLevel = "普通";
        } else if (PRIVILEGE.equals("1")) {
            custLevel = "优质";
        }
        return custLevel;
    }

     /**
     * 订单来源
     * 
     * @param code
     * @return
     */
    public static String getOrderOri(GatewaySource code) {       
         String typeName = "未知";
         switch (code) {
         case GATEWAY_SOURCE_00:
             typeName = "未经网关";
             break;
         case GATEWAY_SOURCE_01:
             typeName = "互联网网关";
             break;
         case GATEWAY_SOURCE_02:
             typeName = "移动网关";
             break;
         case GATEWAY_SOURCE_03:
             typeName = "大宗网关";
             break;       
        case GATEWAY_SOURCE_04:
            typeName = "P2P网关";
            break;       
         }
         return typeName;
    }
    
    /**
     * 订单来源
     * 
     * @param code
     * @return
     */

    public static String  getOrderOri(String code) {
        String typeName = "未知";
        if (StringUtils.equals(code, GatewaySource.GATEWAY_SOURCE_00.value)) {
            typeName = "未经网关";
        } else if (StringUtils.equals(code, GatewaySource.GATEWAY_SOURCE_01.value)) {
            typeName = "互联网网关";
        } else if (StringUtils.equals(code, GatewaySource.GATEWAY_SOURCE_02.value)) {
            typeName = "移动网关";
        } else if (StringUtils.equals(code, GatewaySource.GATEWAY_SOURCE_03.value)) {
            typeName = "大宗网关";
        } else if (StringUtils.equals(code, GatewaySource.GATEWAY_SOURCE_04.value)) {
            typeName = "P2P网关";
        } else{}
        return typeName;
    }
    
    /**
     * 客户状态字典
     * @param custStat
     * @param custType 客户类型：企业，个人
     * @return
     */
    public static String getCustStat(String custStat, String custType) {
        String typeName = "未知";
        if (null != custType && !"".equals(custType)) {
            if ("2".equals(custType)) {// 企业
                if (StringUtils.equals(custStat, CustCorpInfoConstants.CORP_STAT_NORMAL)) {
                    typeName = "正常";
                } else if (StringUtils.equals(custStat, CustCorpInfoConstants.CORP_STAT_CANCEL)) {
                    typeName = "注销";
                } else if (StringUtils.equals(custStat, CustCorpInfoConstants.CORP_STAT_WAIT_EMAIL_CERTIFY)) {
                    typeName = "待邮箱验证";
                } else if (StringUtils.equals(custStat, CustCorpInfoConstants.CORP_STAT_CONSOLE_LOCK)) {
                    typeName = "控制台锁定";
                } else if (StringUtils.equals(custStat, CustCorpInfoConstants.CORP_STAT_WAIT_INFO_PERFECT)) {
                    typeName = "待补全客户信息";
                } else if (StringUtils.equals(custStat, CustCorpInfoConstants.CORP_STAT_AUDIT_REFUSED)) {
                    typeName = "审核不通过";
                } else if (StringUtils.equals(custStat, CustCorpInfoConstants.CORP_STAT_WAIT_AUDIT)) {
                    typeName = "待审核";
                }
            }
            if ("1".equals(custType)) {// 个人
                if (StringUtils.equals(custStat, CustPersonInfoConstants.CUST_STAT_NORMAL)) {
                    typeName = "正常";
                } else if (StringUtils.equals(custStat, CustPersonInfoConstants.CUST_STAT_WAIT_EMAIL_CERTIFY)) {
                    typeName = "待邮箱验证";
                } else if (StringUtils.equals(custStat, CustPersonInfoConstants.CUST_STAT_WAIT_INFO_PERFECT)) {
                    typeName = "待补全客户信息";
                } else if (StringUtils.equals(custStat, CustPersonInfoConstants.CUST_STAT_CANCEL)) {
                    typeName = "注销";
                } else if (StringUtils.equals(custStat, CustPersonInfoConstants.CUST_STAT_CONSOLE_LOCKED)) {
                    typeName = "控制台锁定";
                }
            }
        }
        return typeName;
    }
    
    /**
     * 翻译账户产品
     * 
     * @param ap
     * @return
     */
    public static String getAcctProd(AcctProd ap) {       
         String typeName = "";
         switch (ap) {
         case GNST:
             typeName = "普通账户";
             break;
         case INTR:
             typeName = "国付宝账户";
             break;
         case BLME:
             typeName = "G商银通会员账户";
             break;
         case BLMK:
             typeName = "G商银通资金存管账户";
             break;
         case PPEA:
             typeName = "G商融通专属账户";
             break;
         case PPTA:
             typeName = "G商融通平台账户";
             break;
         case PPRA:
             typeName = "G商融通风险金账户";
             break;
          /*基金添加  baiyunpeng  20160909 start*/
         case FDSFT:
			typeName = "赎回分红退款账户";
			break;
		 case FDSR:
			typeName = "申购认购账户";
			break;
		 /*基金添加  baiyunpeng  20160909 start*/
		 case DFSA:
        	typeName = "资金结算账户";
        	break;
		 default:
			break;
		 }
         return typeName;
    }
    /**
     * 翻译账户产品
     * 
     * @param code
     * @return
     */
    public static String getAcctProd(String code) {
        String typeName = "";
        if (null != code && !"".equals(code)) {
            String codeChange = code.trim();
            if ("GNST".equals(codeChange)) {
                typeName = "普通账户";
            } else if ("INTR".equals(codeChange)) {
                typeName = "国付宝账户";
            } else if ("BLME".equals(codeChange)) {
                typeName = "G商银通会员账户";
            } else if ("BLMK".equals(codeChange)) {
                typeName = "G商银通资金存管账户";
            } else if ("PPEA".equals(codeChange)) {
                typeName = "G商融通专属账户";
            } else if ("PPTA".equals(codeChange)) {
                typeName = "G商融通平台账户";
            } else if ("PPRA".equals(codeChange)) {
                typeName = "G商融通风险金账户";
            } else if ("CLOUD".equals(codeChange)) {
                typeName = "云账户会员账户";
           	/*基金添加  baiyunpeng  20160909 start*/
			} else if ("FDSFT".equals(codeChange)){
				typeName = "赎回分红退款账户";
			} else if("FDSR".equals(codeChange)){
				typeName = "申购认购账户";
				/*基金添加  baiyunpeng  20160909 end*/
			} else if ("DFSA".equals(codeChange) ){
				typeName = "资金结算账户";
			}else {
			}
        }
        return typeName;
    }
    
    /**
     * 翻译上传文件对账状态
     * @param status
     * @return
     */
    public static String getAdjustResult(OrderAdjustRecordStatus status){
        String statusName = "未知";
        switch(status){
        case AUDIT_RESULT_SUCCESS:
            statusName = "成功";
            break;
        case AUDIT_RESULT_FAIL:
            statusName = "失败";
            break;
        case AUDIT_RESULT_NONE:
            statusName = "无此订单";
            break;
        case AUDIT_RESULT_NOLAUNCH:
            statusName = "未发起";
            break;
        case AUDIT_RESULT_NODEAL:
            statusName = "未处理";
            break;
        }
        return statusName;
    }
    
    /**
     * 翻译上传文件对账状态
     * @param status
     * @return
     */
    public static String getAdjustResult(String status){
        String statusName = "未知";
        if(StringUtils.equals(status,OrderAdjustRecordStatus.AUDIT_RESULT_SUCCESS.value)){
            statusName = "成功";
        }else if(StringUtils.equals(status,OrderAdjustRecordStatus.AUDIT_RESULT_FAIL.value)){
            statusName = "失败";
        }else if(StringUtils.equals(status,OrderAdjustRecordStatus.AUDIT_RESULT_NONE.value)){
            statusName = "无此订单";
        }else if(StringUtils.equals(status,OrderAdjustRecordStatus.AUDIT_RESULT_NOLAUNCH.value)){
            statusName = "未发起";
        }else if(StringUtils.equals(status,OrderAdjustRecordStatus.AUDIT_RESULT_NODEAL.value)){
            statusName = "未处理";
        }
        return statusName;
    }

    public static  String getManualAdjustTypeName(String type){
        if(StringUtils.equals(type, ManualAdjustType.CUST_ADJUST.value)){
             return "客户账";
        }else if(StringUtils.equals(type, ManualAdjustType.IN_ADJUST.value)){
            return "内部调账";
        }else if(StringUtils.equals(type, ManualAdjustType.TRANS_ADJUST.value)){
            return "处理交易错账";
        }
        return "";
    }
    //0-待结算,1-全部结算,2-部分结算,3-未结算
    public static String getAutoSettleStatus(String settleSta){
        if(StringUtils.equals("0",settleSta)){
            return "待结算";
        }
        if(StringUtils.equals("1",settleSta)){
            return "全部结算";
        }
        if(StringUtils.equals("2",settleSta)){
            return "部分结算";
        }
        if(StringUtils.equals("3",settleSta)){
            return "未结算";
        }
        return "";
    }
}
